<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>this的指向</title>
</head>
<body>
  <script type="text/javascript">
    var a = 1
    var obj1 = {
      a:2,
      fn:function(){
        console.log(this.a)
        console.log(this)
      }
    } 
    obj1.fn()
  </script>
</body>
</html>